{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "import marvel\n",
    "from IPython.display import Image, HTML, display\n",
    "PUBLIC_KEY = '25b558c56c28ea8839370f72250e7c31'\n",
    "PRIVATE_KEY = '0929fdf08c3134b73388825d209cc712b4657eda'\n",
    "m = marvel.Marvel(PUBLIC_KEY, PRIVATE_KEY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入要查询的英雄（英文，可只输入开头）：captain m\n",
      "搜索中...\n",
      "1010338 Captain Marvel (Carol Danvers)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/6/80/5269608c1be7a/portrait_small.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1011096 Captain Marvel (Genis-Vell)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/b/40/image_not_available/portrait_small.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1009224 Captain Marvel (Mar-Vell)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/f/60/526032048d1a1/portrait_small.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1011095 Captain Marvel (Monica Rambeau)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/9/00/4c0030bee8c86/portrait_small.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1011097 Captain Marvel (Phyla-Vell)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/5/a0/4c0030bc4629e/portrait_small.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1011355 Captain Midlands\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/b/40/image_not_available/portrait_small.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 模糊搜索英雄（名字开头）\n",
    "characters = m.characters\n",
    "# all_characters = characters.all()\n",
    "name = input('请输入要查询的英雄（英文，可只输入开头）：')\n",
    "print('搜索中...')\n",
    "all_characters = characters.all(nameStartsWith=name)\n",
    "for c in all_characters['data']['results']:\n",
    "    print(c['id'], c['name'])\n",
    "    pic = c['thumbnail']\n",
    "    display(Image(url=pic['path']+'/portrait_small.'+pic['extension']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入要查询的英雄ID：1010338\n",
      "搜索中...\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/characters/1010338/captain_marvel_carol_danvers?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel (Carol Danvers)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/6/80/5269608c1be7a/detail.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "搜索中...\n",
      "457 本相关漫画\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/74003/captain_marvel_2019_3?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel (2019) #3</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "74003 $3.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/6/a0/5c8815b53dc19/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/71908/marvels_captain_marvel_the_art_of_the_movie_hardcover?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Marvel's Captain Marvel: The Art Of The Movie (Hardcover)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71908 $0.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/e/10/5c78658021928/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/72696/captain_marvel_braver_mightier_2019_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel: Braver & Mightier (2019) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "72696 $3.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/8/60/5c6ddb0413a31/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/74734/true_believers_captain_marvel_-_earths_mightiest_hero_2019_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">True Believers: Captain Marvel - Earth’s Mightiest Hero (2019) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "74734 $1.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/b/e0/5c6491bcab24c/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/74001/captain_marvel_2019_2?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel (2019) #2</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "74001 $3.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/9/10/5c5c5808aac60/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/71898/captain_marvel_earths_mightiest_hero_vol_5_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel: Earth's Mightiest Hero Vol. 5 (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71898 $24.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/b/40/5c5ca1b4133ac/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/70299/infinity_wars_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Infinity Wars (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "70299 $34.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/5/e0/5c5ca219036c4/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/71899/captain_marvel_ms_marvel_-_a_hero_is_born_hardcover?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel: Ms. Marvel - A Hero Is Born (Hardcover)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71899 $100.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/b/00/5c5ca1c02ab05/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/74730/true_believers_captain_marvel_-_spider-man_and_ms_marvel_2019_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">True Believers: Captain Marvel - Spider-Man and Ms. Marvel (2019) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "74730 $1.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/2/e0/5c523cb262345/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/74729/true_believers_captain_marvel_-_ms_marvel_2019_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">True Believers: Captain Marvel - Ms. Marvel  (2019) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "74729 $1.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/6/b0/5c523cc826f48/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/71528/marvels_captain_marvel_prelude_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Marvel's Captain Marvel Prelude (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71528 $17.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/9/60/5c5385db2b3d7/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/71902/color_your_own_captain_marvel_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Color Your Own Captain Marvel (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71902 $9.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/b/f0/5c4b2817b7bab/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/75783/captain_marvel_start_here_sampler_2019_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel: Start Here Sampler (2019) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "75783 $0.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/8/90/5c4a331ae4a36/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/67951/the_life_of_captain_marvel_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">The Life of Captain Marvel (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "67951 $15.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/5/80/5c814aa21513d/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/73999/captain_marvel_2019_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel (2019) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "73999 $4.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/6/70/5c2f69ce33252/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/75034/scholastic_captain_marvel_mighty_origins_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Scholastic Captain Marvel: Mighty Origins (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "75034 $9.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/5/70/5c252a32017eb/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/collection/72770/captain_marvel_carol_danvers_-_the_ms_marvel_years_vol_3_trade_paperback?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Captain Marvel: Carol Danvers - The Ms. Marvel Years Vol. 3  (Trade Paperback)</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "72770 $34.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/9/10/5c12ec3f20f66/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/71957/marvel_super_hero_adventures_captain_marvel_-_frost_giants_among_us_2018_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Marvel Super Hero Adventures: Captain Marvel - Frost Giants Among Us! (2018) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71957 $3.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/9/00/5c12b3f8e25e0/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/69739/the_life_of_captain_marvel_2018_5?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">The Life of Captain Marvel (2018) #5</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "69739 $3.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/8/c0/5c12b49620bfa/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<a href=\"http://marvel.com/comics/issue/71576/marvels_captain_marvel_prelude_2018_1?utm_campaign=apiRef&utm_source=25b558c56c28ea8839370f72250e7c31\" target=\"_blank\">Marvel's Captain Marvel Prelude (2018) #1</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71576 $3.99\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<img src=\"http://i.annihil.us/u/prod/marvel/i/mg/7/60/5be3732f9978c/portrait_xlarge.jpg\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "hid = input('请输入要查询的英雄ID：')\n",
    "print('搜索中...')\n",
    "character = characters.get(hid)\n",
    "# 英雄信息\n",
    "for c in character['data']['results']:\n",
    "    display(HTML('<a href=\"'+c['urls'][0]['url']+'\" target=\"_blank\">'+c['name']+'</a>'))\n",
    "    print(c['description'])\n",
    "    pic = c['thumbnail']\n",
    "    display(Image(url=pic['path']+'/detail.'+pic['extension']))\n",
    "print('搜索中...')\n",
    "# 漫画信息\n",
    "comics = characters.comics(hid)\n",
    "print(comics['data']['total'], '本相关漫画')\n",
    "for c in comics['data']['results']:\n",
    "    display(HTML('<a href=\"'+c['urls'][0]['url']+'\" target=\"_blank\">'+c['title']+'</a>'))\n",
    "    print(c['id'], '$%.2f'%c['prices'][-1]['price'])\n",
    "    pic = c['thumbnail']\n",
    "    display(Image(url=pic['path']+'/portrait_xlarge.'+pic['extension']))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
